﻿Imports BUS
Public Class frmxlcapnhatloaidocgia


    Private _maLoaiDocGia As Integer
    Public Property MaLoaiDocGia() As Integer
        Get
            Return _maLoaiDocGia
        End Get
        Set(ByVal value As Integer)
            _maLoaiDocGia = value
        End Set
    End Property


    Private _TenLoaiDocGia As String
    Public Property TenLoaiDocGia() As String
        Get
            Return _TenLoaiDocGia
        End Get
        Set(ByVal value As String)
            _TenLoaiDocGia = value
        End Set
    End Property



    Private Sub SimpleButton_Nhap_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton_Nhap.Click
        If TextEdit_TenLoaiDocGia.Text <> "" Then
            Dim sql As String = "Update LOAIDOCGIA Set TenLoaiDocGia=" + "'" + TextEdit_TenLoaiDocGia.Text + "'" + " Where MaLoaiDocGia=" + _maLoaiDocGia.ToString()
            Dim bus As New LoaiDocGiaBUS()
            Dim kq As Integer = bus.CapNhatLoaiDocGia(sql)
            If kq = 1 Then
                MessageBox.Show("Câp nhật thành công !")
                Me.Close()
            Else
                MessageBox.Show("Cập nhật thất bại !")
            End If
        Else
            MessageBox.Show("Nhập tên Loại Đọc Giả !")
        End If
    End Sub
End Class